Skip to content

fix: repair cross-package bugs to make test suite pass#39

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2610-1781455215
Open

fix: repair cross-package bugs to make test suite pass#39
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2610-1781455215

Conversation

@stooit

@stooit stooit commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo. bun test (13 pass / 0 fail) and tsc --noEmit (clean) now both succeed from the repo root.

The bugs spanned all three packages plus the test-environment config.

Changes

File Bug Fix
apps/web/src/lib/api.ts Imported the old hook name useThrottle after it was renamed to useDebounce in @e2e/utils Import/re-export useDebounce (still surfaced as useSearchDebounce)
packages/ui/src/components/Button/Button.tsx ariaLabel prop destructured but never applied Forward aria-label to the rendered <button>
packages/ui/src/components/DataTable/DataTable.tsx Stale-closure bug — sort toggle read sortDir from the closure Use functional updater setSortDir(prev => ...)
packages/utils/src/format/date.ts Explicit month/day/year options forced US MM/DD/YYYY, overriding en-AU Use { dateStyle: 'short' } so en-AU yields day-first DD/MM/YYYY
packages/ui/bunfig.toml Package-local bunfig lacked happy-dom env → document is not defined Add environment = "happy-dom" (keep preload)
bunfig.toml Root test env needed matching preload/env for component tests Aligned test config
tsconfig.json tsc could not resolve bun:test globals Register bun-types

Verification

  • bun test13 pass, 0 fail
  • tsc --noEmitclean (exit 0)

Assumptions

  • The hook rename useThrottle → useDebounce is the intended source name; the public alias useSearchDebounce (asserted by tests) is preserved.
  • The two config files were treated as legitimate non-test config fixes — only the test environment was repaired; no test files modified, no dependencies added.

Constraints honoured

  • No test files modified.
  • No dependencies added.

- api.ts: import renamed useDebounce hook (was stale useThrottle)
- Button: forward aria-label to the rendered button element
- DataTable: use functional state updater to fix stale-closure sort toggle
- date.ts: use dateStyle:'short' so en-AU yields day-first dates
- bunfig.toml / packages/ui/bunfig.toml: apply happy-dom env + preload for component tests
- tsconfig.json: register bun-types so tsc resolves bun:test globals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant